package com.fansaikj.erp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import xyz.erupt.core.annotation.EruptScan;

@SpringBootApplication
@EntityScan
@EruptScan
public class EruptErpApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(EruptErpApplication.class, args);
        Environment env = context.getBean(Environment.class);
        try {
            System.setProperty("java.awt.headless", "false");
//            Desktop.getDesktop().browse(new URI("http://localhost:" + env.getProperty("server.port")));
            System.out.println("Erupt-Erp启动成功");
            System.out.println("---------------------------------------------------");
            System.out.println("http://localhost:" + env.getProperty("server.port"));
            System.out.println("---------------------------------------------------");
        } catch (Exception ignore) {
        }
    }

}
